<?php
/*
 * index.action.php     Zhuayi 会员模块
 *
 * @copyright    (C) 2005 - 2010  zhuayi
 * @licenes      http://www.zhuayi.net
 * @lastmodify   2010-10-28
 * @author       zhuayi
 * @QQ			 2179942
 */
class email_action extends zhuayi
{

	/* 构造函数 */
	function __construct()
	{

		
	}

	/* 邮件输入提示 */
	function tips($email)
	{
		$email = urldecode($email);
		$email_array = array(
								'@qq.com',
								'@163.com',
								'@126.com',
								'@sina.com',
								'@sina.cn',
								'@yahoo.com.cn',
								'@yahoo.cn',
								'@189.cn',
								'@sohu.com',
								'@gmail.com',
								'@hotmail.com',
								'@139.com',
							);
		
		preg_match_all("/([a-z0-9]*[-_\.]?[a-z0-9]+)*@(.*)?/i", $email,$val);
		
		if (!empty($val[1][0]))
		{
			$email  = $val[1][0];
		}
		$email_age = $val[2][0];
		
		foreach ($email_array as $key=>$val)
		{
			if (strpos('%'.$val,$email_age)>0 || $email_age=='')
			echo '<li tabindex="0">'.$email.$val.'</li>';
		}
	}
	
	
	/* 返回邮件后缀 */
	function email_url($email)
	{
		preg_match_all("/([a-z0-9]*[-_\.]?[a-z0-9]+)*@(.*)?/i", $email,$val);
		return $val[2][0];
	}





}

?>